const sortData = function compare(propertyName) {
    return function(object1, object2) {
        var value1 = object1[propertyName];
        var value2 = object2[propertyName];
        if (Math.abs(value2) < Math.abs(value1)) {
            return -1;
        } else if (Math.abs(value2) > Math.abs(value1)) {
            return 1;
        } else {
            return 0;
        }
    }
}
export { sortData }